/**
 * 编码参数
 * @param params
 * @returns {string}
 */
export default function incodeParams(params = {}) {
    let all = '';
    const componentIds = Object.keys(params);
    componentIds.forEach((componentId, j) => {
        const value = params[componentId];// {row:'1'}
        let str = `${componentId}#`;
        if (value) {
            const list = Object.keys(value);
            list.forEach((pId, i) => {
                str = str.concat(`${pId}:${value[pId]}`);
                if (i < list.length - 1) {
                    str = str.concat('$');
                }
            });
        }
        all = all.concat(str);
        if (j < componentIds.length - 1) {
            all = all.concat('|');
        }
    });
    return all;
}